 import * as type from './type';
 import http from 'utils/http';

 const actionCreators = {
    getData(data){
        return async dispatch => {
            const result = await http({
                url:'/tuan1/'+ data +'.json'
            })
            const action = {
                type: type.GET_DATA,
                payload: result
            }
            dispatch(action);
        }
    },
    getDetailsData(id){
        return async dispatch => {
            const result = await http({
                url:'/tuan1/details/ht20190715110010p4938930.json'
            })
            const action = {
                type: type.GET_Details_DATA,
                payload: result.data.data
            }
            dispatch(action);
        }
    }
 }

 export default actionCreators;